cmake_minimum_required(VERSION 3.10)
project(drone_demo)

# 设置C标准
set(CMAKE_C_STANDARD 11)

# 添加编译选项
add_compile_options(-Wall -Wextra -Werror)

# 查找系统依赖
find_package(Threads REQUIRED)

# 创建主程序目标
add_executable(drone_demo 
    src/main.c
    src/modules/video.c
    src/modules/camera.c
    src/modules/download.c
    src/modules/ota.c
    src/modules/protocol.c
    src/utils/log.c
    src/utils/config.c
    src/utils/error.c
)

# 包含头文件目录
target_include_directories(drone_demo PRIVATE 
    ${CMAKE_SOURCE_DIR}/src
    ${CMAKE_SOURCE_DIR}/src/modules
    ${CMAKE_SOURCE_DIR}/src/utils
)

# 链接系统库
target_link_libraries(drone_demo PRIVATE Threads::Threads)